
<?php
$title = $this->menu;
$this->headTitle($title);
if($this->chuyenmuc != "" && $this->baiviet == ""){


		
		
		?>
		<script type="text/javascript">
		
		function sapxep(page,cot,sapxep){
							var sapxep        = sapxep;
						if(page==""){
							if($('.sort').attr('class') == "sort DESC"){
								$('.sort').removeClass('DESC');
								$('.sort').addClass('ASC');
								sapxep = "ASC";
							}
							else if($('.sort').attr('class') == "sort ASC"){
								$('.sort').removeClass('ASC');
								$('.sort').addClass('DESC');
								sapxep = "DESC";
							}
							else if($('.sort').attr('class') == "sort"){
								
								$('.sort').addClass('DESC');
								sapxep = "DESC";
							}
						}
							
							var cot        = cot;
							
							$.ajax({
								type: "POST", // phương thức gởi đi
								url: "http://localhost/doan/public/<?php echo $this->chuyenmuc ?>", // nơi mà dữ liệu sẽ chuyển đến khi submit
								data: "page="+ page +"&order_by="+ cot +"&order="+ sapxep, // giá trị post
								success: function(answer){ // if everything goes well
									
									$('body').html(answer); // đặt kết quả trả về từ test.php vào thẻ div success
								}
							});
		}
							 
		
		</script>
 <div class="nav-bar">
<span class="crust">
					<a href="<?php echo $this->url('Home', array('action' => 'index','menu' => $chuyenmuc));
        ?>" class="crumb"><span><?php  echo $tenchuyenmuc ?></span></a>
					<span class="arrow"><span></span></span>
</span>

</div>
		<div id="content">
		
			<?php foreach ($paginator as $tintuc) : ?>
            	<div class="column4">
        				<div class="offer_box_wide">
                        	<a href="<?php echo $this->chuyenmuc."/"; echo $this->escapeHtml($tintuc->linkrutgon); ?>"><img src="<?php  echo $this->escapeHtml($tintuc->hinhanh); ?>" width="120px" height="80px" align="left" alt="" title="" border="0"></a>
                            <div class="offer_info">
                                <span><a href="<?php echo $this->chuyenmuc."/"; echo $this->escapeHtml($tintuc->linkrutgon); ?>"><?php echo $this->escapeHtml($tintuc->tieude); ?></a></span>
                               <a href="<?php echo $this->chuyenmuc."/"; echo $this->escapeHtml($tintuc->linkrutgon); ?>"> <p class="offer">Ngày đăng: <?php echo $this->escapeHtml($tintuc->ngaydang); ?></p></a>
                                <a href="<?php echo $this->chuyenmuc."/"; echo $this->escapeHtml($tintuc->linkrutgon); ?>"><p class="offer"><?php echo $this->escapeHtml($tintuc->mota); ?></p></a>
                                
                            </div>
           				</div>
                        <div class="more"><a href="<?php echo $this->chuyenmuc."/"; echo $this->escapeHtml($tintuc->linkrutgon); ?>">Xem tiếp...</a></div>
            		</div>
            
            <div style="clear:both;"></div>
			<?php endforeach; ?>
		
		<?php
			echo $this->paginationControl(
					$paginator, 'Sliding', 'paginator-slide', array('order_by' => $order_by, 'order' => $order)
			);
			?>
		</div>
<?php
}
else if($this->chuyenmuc != "" && $this->baiviet != ""){
?>	
<div class="nav-bar">
<span class="crust">
					<a href="<?php echo $this->url('Home', array('action' => 'index','menu' => $chuyenmuc));
        ?>" class="crumb"><span><?php echo $baiviet->tenchuyenmuc ?></span></a>
					<span class="arrow"><span></span></span>
</span>
<span class="crust">
					<a class="crumb" href="#"><span><?php echo $baiviet->tieude ?></span></a>
					<span class="arrow"><span></span></span>
</span>
</div>
<div id="printarea">
<link type="text/css" href="../css/truonghoc.css" />
		<div class="column4">
        	<div class="box_width_common" style="width: 100%; padding: 0px; height: 17px;">
                                <div class="time txt_666 left txt_11"><?php echo $baiviet->ngaydang;?></div>
                                <div class="list_share_icon right">
                                
                                <div id="fb-root"></div>
	<script>(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=1447609522121545";
    fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
    <script type="text/javascript">
    function printDiv(divName) {
     var printContents = document.getElementById(divName).innerHTML;
     var originalContents = document.body.innerHTML;

     document.body.innerHTML = "<link rel=\"stylesheet\" type=\"text/css\"  href=\"../css/truonghoc.css\">\n</head><body><div style=\"testStyle\">"+printContents+ "\n</div>\n</body>\n</html>";

     window.print();

     document.body.innerHTML = originalContents;
}
    </script>                            
                                    <ul>
                                    <li>
                                    	<fb:like href="http://q1.edu.vn" send="false" layout="button_count" width="100" show_faces="false"></fb:like>
                                    </li>
                                    <li style="margin-right:-35px">
                                    	<a href="http://twitter.com/share" class="twitter-share-button" data-text="VIETNAM IT OUTSOURCING" data-count="horizontal">Tweet</a>
      <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
                                    </li>
                                    <li style="margin-right:-35px">
                                    	<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script><g:plusone size="medium"></g:plusone>
                                    </li>

    <li><a onclick="printDiv('printarea')"   id="print_content" class="icon_portal_thethao icon_printer" alt="Print" title="Print">&nbsp;</a></li>
    
</ul>                                </div>
                            </div>
                            <div style="clear:both; margin-bottom:10px"></div>
             	<div id="content-head">
                	
                    <div id="content-tieude"><?php echo $baiviet->tieude;?></div>
                    <div id="content-mota"><?php echo $baiviet->mota;?></div>
                    
                   
                </div>
                <div id="content-info"><?php echo $baiviet->noidung;?></div>
                
                
                </div>
               </div>
                <div id="relative">
               		<div id="relative_title">Xem thêm tin khác</div>
                	<div id="relative_content">
                        <ul>
                        
                        <?php foreach ($baiviet_lienquan as $bv) : ?>
                        
                            <li><a href="<?php echo $this->escapeHtml($bv->linkrutgon); ?>"><?php echo $this->escapeHtml($bv->tieude); ?></a></li>
                        <?php endforeach; ?>
                        </ul>
                	</div>
                   
          		</div>
               
<?
}
else{
?>

<script type="text/javascript">
    $(window).load(function() {
        $('#slider-banner').nivoSlider();
    });
    </script>

			<div class="slider-wrapper theme-default">
                    <div id="slider-banner" class="nivoSlider">
                    	<?php foreach ($sliders as $slider) : ?>
                        <img src="<?php echo $this->escapeHtml($slider->hinhanh); ?>" width="570" height="270" >
                         
                        <?php endforeach; ?>
                        		
                    </div>
                    
                </div><!-- end slider -->
					
            
            
				
			<!-- het tap huan giao vien -->
			<!-- thong bao -->
				<div class="baond" style="margin-top: 10px;">
					<div class="vienndc">
						<div class="nendmndc">
							<div style="float: left;margin-left: 10px;margin-top: 19px;"><img alt="dau" src="images/dauvang.jpg" width="7" height="7"> </div>
							<div style="text-align: left;margin-top: 10px;float: left;margin-left: 10px; color:#FFF">Thông báo</div>
						</div>
                   
						<?php foreach ($thongbao as $thongbao) : ?>
                       
            	<div class="column4">
        				<div class="offer_box_wide">
                        	<a href="<?php echo "thong-bao/"; echo $this->escapeHtml($thongbao->linkrutgon); ?>"><img src="<?php  echo $this->escapeHtml($thongbao->hinhanh); ?>" width="120px" height="80px" align="left" alt="" title="" border="0"></a>
                            <div class="offer_info">
                                <span><a href="<?php echo "thong-bao/";  echo $this->escapeHtml($thongbao->linkrutgon); ?>"><?php echo $this->escapeHtml($thongbao->tieude); ?></a></span>
                               <a href="<?php echo "thong-bao/"; echo $this->escapeHtml($thongbao->linkrutgon); ?>"> <p class="offer">Ngày đăng: <?php echo $this->escapeHtml($thongbao->ngaydang); ?></p></a>
                                <a href="<?php echo "thong-bao/"; echo $this->escapeHtml($thongbao->linkrutgon); ?>"><p class="offer"><?php echo $this->escapeHtml($thongbao->mota); ?></p></a>
                                
                            </div>
           				</div>
                        
            		</div>
            
            <div style="clear:both;"></div>
           
			<?php endforeach; ?>
          
						<div class="duonggach"></div>
						<div class="more"><a href="thong-bao">Xem tất cả >> </a></div>
					</div>
				</div>
			<!-- het thong bao -->
			<!-- tin tuc -->
				<div class="baond" style="margin-top: 10px;">
					<div class="vienndc">
						<div class="nendmndc">
							<div style="float: left;margin-left: 10px;margin-top: 19px;"><img alt="dau" src="images/dauvang.jpg" width="7" height="7"> </div>
							<div style="text-align: left;margin-top: 10px;float: left;margin-left: 10px; color:#FFF">Tin tức</div>
						</div>
                 <ul id="news-home">
						<?php foreach ($tintucs as $tintuc) : ?>
                   <li>
            	<div class="column4">
        				<div class="offer_box_wide">
                        	<a href="<?php echo $this->escapeHtml($tintuc->duongdan)."/"; echo $this->escapeHtml($tintuc->linkrutgon); ?>"><img src="<?php  echo $this->escapeHtml($tintuc->hinhanh); ?>" width="120px" height="80px" align="left" alt="" title="" border="0"></a>
                            <div class="offer_info">
                                <span><a href="<?php echo $this->escapeHtml($tintuc->duongdan)."/";  echo $this->escapeHtml($tintuc->linkrutgon); ?>"><?php echo $this->escapeHtml($tintuc->tieude); ?></a></span>
                               <a href="<?php echo $this->escapeHtml($tintuc->duongdan)."/"; echo $this->escapeHtml($tintuc->linkrutgon); ?>"> <p class="offer">Ngày đăng: <?php echo $this->escapeHtml($tintuc->ngaydang); ?></p></a>
                                <a href="<?php echo $this->escapeHtml($tintuc->duongdan)."/"; echo $this->escapeHtml($tintuc->linkrutgon); ?>"><p class="offer"><?php echo $this->escapeHtml($tintuc->mota); ?></p></a>
                                
                            </div>
           				</div>
                        
            		</div>
            
            <div style="clear:both;"></div>
           </li>
			<?php endforeach; ?>
           </ul>
			<script type="text/javascript">
            function newshome(){
			$('#news-home li:first').animate({'opacity':0}, 200, function () { 
            	$(this).appendTo($('#news-home')).css('opacity', 1); });
			
			
        }
		function thongbaohome(){
			$('#thongbao-home li:first').slideUp( function () { $(this).appendTo($('#thongbao-home')).slideDown(); });
		}
        setInterval(function(){ newshome () }, 5000);
		setInterval(function(){ thongbaohome () }, 6000)
        </script>				
					</div>
				</div>
<?php } ?>